package com.roadjava.GDOUGym.controller.admin;


import com.roadjava.GDOUGym.bean.dto.DenueHireMessageDTO;
import com.roadjava.GDOUGym.bean.res.ResultDTO;
import com.roadjava.GDOUGym.bean.res.TableResult;
import com.roadjava.GDOUGym.service.FundStatisticsService;
import com.roadjava.GDOUGym.service.GameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.lang.reflect.Array;
import java.text.SimpleDateFormat;
import java.util.*;

@Controller
@Slf4j
@RequestMapping("/fundStatistics")
public class FundStatisticsController {
    @Resource
    private FundStatisticsService fundStatisticsService;

    //查询场地
    @RequestMapping ("findSite") @ResponseBody
    public Map<String,List> findSite(){
        Map<String, List> map = new HashMap<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
        Date date = new Date();
        int year = Integer.parseInt(sdf.format(date));

        List year10= new ArrayList<>();


        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);
        year10.add(1000);



        map.put(year+"",year10);
        map.put((year-1)+"",year10);
        map.put((year-2)+"",year10);
        map.put((year-3)+"",year10);
        map.put((year-4)+"",year10);
        map.put((year-5)+"",year10);
        map.put((year-6)+"",year10);
        map.put((year-7)+"",year10);
        map.put((year-8)+"",year10);
        map.put((year-9)+"",year10);
        System.out.println("map = " + map);
        return map;
    }

    //索引场地页面到赛事审核页面
    @GetMapping("/toFundStatistics")
    public String toFundStatistics() {
        return "admin/admin/fundStatistics";
    }
}
